﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using TheHeGeoCommercial.Master;

namespace TheHeGeoCommercial.Welcome
{
    public partial class RootHomeMaster : System.Web.UI.MasterPage
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            vMenu.Controls.Clear();
            var thiNghiem = (UcVMenu)Page.LoadControl("~/Master/UcVMenu.ascx");
            thiNghiem.MenuTxt = "Trang chủ";
            thiNghiem.Url = "../Welcome/Welcome.aspx";
            vMenu.Controls.Add(thiNghiem);

            var thiNghiem2 = (UcVMenu)Page.LoadControl("~/Master/UcVMenu.ascx");
            thiNghiem2.MenuTxt = "TheHeGeo";
            thiNghiem2.Url = "http://thehegeo.com/";
            vMenu.Controls.Add(thiNghiem2);

            var thiNghiem3 = (UcVMenu)Page.LoadControl("~/Master/UcVMenu.ascx");
            thiNghiem3.MenuTxt = "Monitoring";
            thiNghiem3.Url = "http://geotechnical.vn:8888/";
            vMenu.Controls.Add(thiNghiem3);

            var thiNghiem4 = (UcVMenu)Page.LoadControl("~/Master/UcVMenu.ascx");
            thiNghiem4.MenuTxt = "News";
            thiNghiem4.Url = "../News/News.aspx";
            vMenu.Controls.Add(thiNghiem4);

            var thiNghiem6 = (UcVMenu)Page.LoadControl("~/Master/UcVMenu.ascx");
            thiNghiem6.MenuTxt = "Shopping";
            thiNghiem6.Url = "../Commercial/Products.aspx";
            vMenu.Controls.Add(thiNghiem6);

            
            

           
            var thiNghiem5 = (UcVMenu)Page.LoadControl("~/Master/UcVMenu.ascx");
            thiNghiem5.MenuTxt = "Software";
            thiNghiem5.Url = "http://geotechnical.vn:8888/";
            vMenu.Controls.Add(thiNghiem5);

        }

        public static string GetCurrentDictName()
        {
            string sPath = HttpContext.Current.Request.Url.AbsolutePath;
            var oInfo = new System.IO.FileInfo(sPath);
            var str = oInfo.Directory == null ? string.Empty : oInfo.Directory.Name;
            return str;
        }

        public static string GetCurrentFile(){
            string sPath = HttpContext.Current.Request.Url.AbsolutePath;
            var oInfo = new System.IO.FileInfo(sPath);
            return oInfo.Name;
        }
    }
}